import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: HomeView,
    redirect: '/sys-admin/index',
    children: [
      {
        path: '/sys-admin/index', // http://localhost:9000/sys-admin/index
        component: () => import('../views/sys-admin/AdminIndexView.vue')
      },
      {
        path: '/sys-admin/product/spu-management', // http://localhost:9000/sys-admin/product/spu-management
        component: () => import('../views/sys-admin/product/SpuManagementView.vue')
      },
      {
        path: '/sys-admin/product/spu-add-new', // http://localhost:9000/sys-admin/product/spu-add-new
        component: () => import('../views/sys-admin/product/SpuAddNewStep1View.vue')
      },
      {
        path: '/sys-admin/product/spu-add-new2', // http://localhost:9000/sys-admin/product/spu-add-new2
        component: () => import('../views/sys-admin/product/SpuAddNewStep2View.vue')
      },
      {
        path: '/sys-admin/product/spu-add-new3', // http://localhost:9000/sys-admin/product/spu-add-new3
        component: () => import('../views/sys-admin/product/SpuAddNewStep3View.vue')
      },
      {
        path: '/sys-admin/product/spu-add-new4', // http://localhost:9000/sys-admin/product/spu-add-new4
        component: () => import('../views/sys-admin/product/SpuAddNewStep4View.vue')
      },
      {
        path: '/sys-admin/product/album-management', // http://localhost:9000/sys-admin/product/album-management
        component: () => import('../views/sys-admin/product/AlbumManagementView.vue')
      },
      {
        path: '/sys-admin/product/category-management', // http://localhost:9000/sys-admin/product/category-management
        component: () => import('../views/sys-admin/product/CategoryManagementView.vue')
      },
      {
        path: '/sys-admin/product/attribute-template-management', // http://localhost:9000/sys-admin/product/attribute-template-management
        component: () => import('../views/sys-admin/product/AttributeTemplateManagementView.vue')
      },
      {
        path: '/sys-admin/product/brand-management', // http://localhost:9000/sys-admin/brand-management
        component: () => import('../views/sys-admin/product/BrandManagementView.vue')
      },

      {
        path: '/sys-admin/temp/admin/add-new',
        component: () => import('../views/sys-admin/temp/AdminAddNewView.vue')
      },
      {
        path: '/sys-admin/temp/admin/list',
        component: () => import('../views/sys-admin/temp/AdminListView.vue')
      },
      {
        path: '/sys-admin/temp/album/add-new',
        component: () => import('../views/sys-admin/temp/AlbumAddNewView.vue')
      },
      {
        path: '/sys-admin/temp/album/list',
        component: () => import('../views/sys-admin/temp/AlbumListView.vue')
      },
      {
        path: '/sys-admin/temp/brand/add-new',
        component: () => import('../views/sys-admin/temp/BrandAddNewView.vue')
      },
      {
        path: '/sys-admin/temp/brand/list',
        component: () => import('../views/sys-admin/temp/BrandListView.vue')
      },
      {
        path: '/sys-admin/temp/category/add-new',
        component: () => import('../views/sys-admin/temp/CategoryAddNewView.vue')
      },
      {
        path: '/sys-admin/temp/category/list',
        component: () => import('../views/sys-admin/temp/CategoryListView.vue')
      },
      {
        path: '/sys-admin/temp/attribute-template/add-new',
        component: () => import('../views/sys-admin/temp/AttributeTemplateAddNewView.vue')
      },
      {
        path: '/sys-admin/temp/attribute-template/list',
        component: () => import('../views/sys-admin/temp/AttributeTemplateListView.vue')
      },
      {
        path: '/sys-admin/temp/attribute/add-new',
        component: () => import('../views/sys-admin/temp/AttributeAddNewView.vue')
      },
      {
        path: '/sys-admin/temp/attribute/list',
        component: () => import('../views/sys-admin/temp/AttributeListView.vue')
      },
    ]
  },
  {
    path: '/login',
    component: () => import('../views/LoginView.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
